<template>
    <el-row>
        <Info :cntInfo="info.cntinfo"></Info>
        <el-row :gutter="10" class="box box-pack-between mt10">
            <el-col :span="8">
                <Ldsj ref="ldsj" :ldsj="info.sjpercentlist" />
            </el-col>

            <el-col :span="16">
                <Daka :daka="info.dakalist"></Daka>
            </el-col>
        </el-row>
        <el-row :gutter="10" class="box box-pack-between mt10">
            <el-col :span="8">
                <Ldfcdb ref="ldfc" :echartData="info.fengcailist" />
                <Kcdf :KcData="info.defenlist" class="mt10" />
            </el-col>
            <el-col :span="8">
                <Ldfc :LdfcData="info.fabulist" />
            </el-col>
            <el-col :span="8">
                <Xxsc :Time="info.xuexilist" />
            </el-col>
        </el-row>
    </el-row>
</template>
<script>
    import Info from './components/info.vue';
    import Ldsj from './components/ldsj.vue';
    import Daka from './components/daka.vue';
    import Ldfc from './components/ldfc.vue';
    import Xxsc from './components/xxsc.vue';
    import Kcdf from './components/kcdf.vue';
    import Ldfcdb from './components/ldfcdb.vue';
    export default {
        components:{
            Info,Ldsj,Daka,Ldfc,Xxsc,Kcdf,Ldfcdb
        },
        data() {
            return {
                info: {
                    cntinfo: {},
                    dakalist: [],
                    defenlist: [],
                    fabulist: [],
                    fengcailist: [],
                    sjpercentlist: [],
                    xuexilist: []
                }
            }
        },
        created() {
            this.getSchoolData()
        },

        methods: {
            getSchoolData() {
                
                let url = this.$store.state.maxRole == 'team'?"/tongji/teamindex":"/tongji/adminindex";
                let params = {
                    schoolid: this.$store.state.schoolId,
                };
                this.$ajax.post(url, params).then(res => {
                    console.log(res);
                    if (res) {
                        this.info = res
                        this.$nextTick(()=>{
                            this.$refs.ldfc.init()
                            this.$refs.ldsj.init()
                        })
                    }
                })
            }
        }
    }
</script>
<style scoped>

</style>
